Elisp Data Structures: Lists

Table of Contents

Lisp Lists are implemented as linked lists. Each element can be any type and need not to be of same type.

1. Cons Cell and List Types

A cons cell is an object consisting of 2 slots, the car slot and the cdr slot. A list is a series of cons cells, linked together so that the cdr of previous cons cell either holds the next cell or the empty list. The car slot stores the actual object.

Dotted pair notation is a general syntax for cons cells that represents the car and cdr explicitly. (a . b) stands for a cons cell whose car is object a and cdr is object b.

Association list is a specially-constructed list whose elements are cons cells. In each cons cell, the car is considered as a key, and the cdr is considered as the associated value. They are usually used as stacks.

Date: 2026-07-22 Wed